#ifndef COM_H
#define COM_H
#include "stdbool.h"

#define RX_BUFF_SIZE 64

typedef enum
{
	kUart0,
	kUart1, 
	kUartMax,
}UartID;

typedef struct
{
  int first_rx_index;
  int last_rx_index;
  char rx_buff[RX_BUFF_SIZE];  
  bool new_data_flag;
}UartRxBuf;

int UartReceivedBufferSize(UartID uart_port);
char UartReceiveByte(UartID uart_port);
bool UartGetNewDataFlag(UartID uart_port);
void UartClearNewDataFlag(UartID uart_port);
void UartOnReceiveNewByte(UartID port, char ch);
void ComHandleNewReceiveChar(UartID com);

/*  
if (UartGetNewDataFlag(kUart0)){
    UartClearNewDataFlag(kUart0);
    ComHandleNewReceiveChar(kUart0);
}
*/

#endif
